package com.amigo.online.common.util;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class Md5Util {
	
	/**
	 * 密码
	 */
	public static String encrypt(String password) {
		return new BCryptPasswordEncoder().encode(password);
	}
	
	/**
	 * 匹配密码
	 * @param rawPassword
	 * @param encodedPassword
	 * @return
	 */
	public static boolean matches(CharSequence rawPassword, String encodedPassword) {
		return new BCryptPasswordEncoder().matches(rawPassword, encodedPassword);
	}
}
